/* 文件管理器覆盖层 - 移除紫色背景 */
.file-manager-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  pointer-events: none; /* 让背景点击穿透 */
}

/* 文件管理器容器 - 全新设计 */
.file-manager-container {
  width: 100%;
  height: 100%;
  min-height: 700px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 24px;
  box-shadow:
    0 25px 50px rgba(0, 0, 0, 0.15),
    0 10px 20px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  backdrop-filter: blur(20px);
}

/* 装饰性浮动文件夹 */
.file-manager-container::before {
  content: '📁';
  position: absolute;
  left: -30px;
  top: 25%;
  width: 60px;
  height: 60px;
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.3;
  z-index: 1;
  animation: floatFolder 4s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.2));
}

.file-manager-container::after {
  content: '📂';
  position: absolute;
  right: -30px;
  bottom: 35%;
  width: 50px;
  height: 50px;
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.25;
  z-index: 1;
  animation: floatFolder 5s ease-in-out infinite reverse;
  filter: drop-shadow(0 4px 8px rgba(118, 75, 162, 0.2));
}

/* 文件夹浮动动画 */
@keyframes floatFolder {
  0%, 100% {
    transform: translateY(0px);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-15px);
    opacity: 0.5;
  }
}

/* 文件管理器内容容器 */
.file-manager-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  margin: 2px;
  border-radius: 22px;
  overflow: hidden;
  min-height: 0; /* 确保flex子元素能够正确收缩 */
}

/* 顶部标题栏 - 全新设计 */
.file-manager-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
  backdrop-filter: blur(20px);
  color: #1e293b;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 22px 22px 0 0;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.file-manager-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
  pointer-events: none;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.folder-icon {
  font-size: 32px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

.file-manager-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.025em;
}

.material-count {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  letter-spacing: 0.025em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.settings-btn,
.close-btn {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 126, 234, 0.2);
  color: #475569;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-btn:hover,
.close-btn:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
  border-color: transparent;
}

/* 工具栏 - 重新设计 */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.8) 100%);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.3);
  position: relative;
}

.toolbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
  pointer-events: none;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.file-manager-icon {
  font-size: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

.toolbar-title {
  font-weight: 700;
  color: #1e293b;
  font-size: 16px;
  letter-spacing: -0.025em;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.search-container {
  position: relative;
}

.search-input {
  padding: 12px 20px;
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: 25px;
  font-size: 14px;
  outline: none;
  width: 320px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-weight: 500;
  color: #1e293b;
}

.search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
  background: white;
  transform: translateY(-1px);
}

.search-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.upload-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.upload-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

/* 文件列表 - 重新设计 */
.file-list {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  position: relative;
  min-height: 400px; /* 确保有足够的最小高度 */
  display: flex;
  flex-direction: column;
}

.file-list::-webkit-scrollbar {
  width: 8px;
}

.file-list::-webkit-scrollbar-track {
  background: rgba(248, 250, 252, 0.5);
  border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* 空状态样式 - 全新设计 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1; /* 占满父容器的剩余空间 */
  min-height: 350px;
  color: #64748b;
  text-align: center;
  padding: 48px;
  cursor: pointer;
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px dashed rgba(102, 126, 234, 0.3);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.6) 100%);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.empty-state:hover {
  background: linear-gradient(145deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
}

.empty-state:hover::before {
  opacity: 1;
}

.empty-icon {
  font-size: 80px;
  margin-bottom: 32px;
  opacity: 0.7;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.2));
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
  animation: floatFolder 3s ease-in-out infinite;
}

.empty-state:hover .empty-icon {
  opacity: 1;
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 8px 20px rgba(102, 126, 234, 0.4));
}

.empty-text {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
  letter-spacing: -0.025em;
  position: relative;
  z-index: 1;
}

.empty-state:hover .empty-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.empty-hint {
  font-size: 16px;
  opacity: 0.8;
  line-height: 1.6;
  max-width: 350px;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.empty-state:hover .empty-hint {
  opacity: 1;
  color: #667eea;
}

/* 文件项 - 全新卡片设计 */
.file-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(102, 126, 234, 0.1);
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(102, 126, 234, 0.1);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.file-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.file-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.file-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.12),
    0 8px 20px rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.3);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
}

.file-item:hover::before {
  opacity: 1;
}

.file-item:hover::after {
  opacity: 1;
}

/* 文件图标 - 重新设计 */
.file-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
  position: relative;
  z-index: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.file-item:hover .file-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.file-info {
  flex: 1;
  position: relative;
  z-index: 1;
}

.file-name {
  font-weight: 700;
  background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.025em;
  transition: all 0.3s ease;
}

.file-item:hover .file-name {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.file-details {
  color: #64748b;
  font-size: 14px;
  display: flex;
  gap: 12px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.file-item:hover .file-details {
  color: #475569;
}

.file-details::before {
  content: '';
}

.file-details > *:not(:last-child)::after {
  content: ' • ';
  margin: 0 4px;
  color: #94a3b8;
}

/* 新增功能样式 */
.file-count {
  font-size: 12px;
  color: #6c757d;
  margin-left: 8px;
}

.view-mode-toggle {
  display: flex;
  gap: 2px;
  margin-right: 8px;
}

.view-btn {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn:first-child {
  border-radius: 4px 0 0 4px;
}

.view-btn:last-child {
  border-radius: 0 4px 4px 0;
}

.view-btn.active {
  background: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.sort-select {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 8px;
  outline: none;
}

.sort-select:focus {
  border-color: #4CAF50;
}

.file-item.list {
  flex-direction: row;
  padding: 8px 12px;
  margin-bottom: 4px;
}

.file-item.grid {
  flex-direction: column;
  padding: 12px;
  text-align: center;
  width: calc(25% - 8px);
  margin: 4px;
}

.file-item.selected {
  background: #e3f2fd;
  border-color: #2196f3;
}

.compressed-badge {
  background: #ff9800;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
}

.file-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.file-item:hover .file-actions {
  opacity: 1;
}

.preview-btn {
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.preview-btn:hover {
  background: #1976d2;
}

/* 文件预览模态框 */
.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.preview-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80%;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.preview-header {
  background: #f8f9fa;
  padding: 16px 20px;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-header h3 {
  margin: 0;
  font-size: 18px;
  color: #212529;
}

.close-preview-btn {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.close-preview-btn:hover {
  background: #c82333;
}

.preview-body {
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
}

.file-preview-info {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.preview-icon {
  font-size: 48px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 8px;
}

.preview-details {
  flex: 1;
}

.preview-details p {
  margin: 8px 0;
  font-size: 14px;
  color: #495057;
}

.preview-placeholder {
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  color: #6c757d;
}

.preview-placeholder p {
  margin: 8px 0;
}
